<?php
class DefaultApp extends BackendApp
{
    function index()
    {
		/* 配置seo信息 */
		$this->_config_seo(array( 'title' => Conf::get('site_name').'-首页' ));	
        $this->import_resource(array(
            //'script' => array( array( 'path' => 'res:style/cycle.js' )),
			'style' =>  'res:style/css_wap.css',
        ));
		
		$this->assign('new_list', $this->_get_article());//调出新闻公告
		$this->display('index.html');
	}
	function aboutus()
	{
		$this->_config_seo(array( 'title' => Conf::get('site_name').'-联系客服' ));		
		$this->assign('curitem', '联系客服');	
		$this->display('aboutus.html');
	}
	
	//获取新闻文章
    function _get_article($type='')
    {
        //缓存数据调用
		$cache_server =& cache_server();		
		$key = 'article_get_index';
        $articles = $cache_server->get($key);
        if ($articles === false)
        {		
			$_article_mod = &m('article');
			$articles = $_article_mod->find(array(
				'conditions'  => 'if_show=1 AND store_id=0 AND code = "" AND cate_id=2',
				'fields'     => 'article_id,title,cate_id,link,add_time',
				'limit'   => 6,
				'order'   => "add_time DESC,sort_order ASC",
			)); //找出所有符合条件的文章
			
			$cache_server->set($key, $articles, 1800);//半个小时更新一次
		}
        return $articles;
    }
	
}
?>